package com.example.springboot;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

/**
 * @author liuyy
 * @date 2019年5月20日16:15:00
 * 主程序启动
 */
@SpringBootApplication
@MapperScan("com.example.springboot.mapper")
@ServletComponentScan
public class SpringbootApplication implements ApplicationRunner {

	private static final Logger logger = LogManager.getLogger(SpringbootApplication.class);
	public static void main(String[] args) {
		SpringApplication.run(SpringbootApplication.class, args);

	}
	@Override
	public void run(ApplicationArguments applicationArguments) throws Exception {
		logger.debug("Debugging log");
		logger.info("Info log");
		logger.warn("Hey, This is a warning!");
		logger.error("Oops! We have an Error. OK");
		logger.fatal("Damn! Fatal error. Please fix me.");
	}

}

